from django.urls import path
from user.views import LoginView, ImageView
from user.views_management import SchoolView, SchoolViewTow
from user.views_management import TeacherViewTow, TeacherView
from user.views_management import ClassViewTow, ClassView
from user.views_management import StudentViewTow, StudentView
from user.views_management import UserView, UserViewTow

urlpatterns = [
    # 登录的路由
    path('login/',LoginView.as_view()),

    # 图片验证码的路由
    path("image/<str:uuid>", ImageView.as_view()),

    # 用户信息
    path("users/", UserView.as_view()),
    path("user/<int:id>",UserViewTow.as_view({"get": "one_user", "delete": "del_user", "put": "upd_user"})),

    # 学校
    path("schools/", SchoolView.as_view({"get": "all_school", "post": "add_school"})),
    path("school/<int:id>", SchoolViewTow.as_view({"get": "one_school", "put": "upd_school", "delete": "del_school"})),

    # 班级
    path("classes/",ClassView.as_view({"get": "all_class","post": "add_class"})),
    path("class/<int:id>",ClassViewTow.as_view({"get": "one_class","put": "upd_class","delete": "del_class"})),

    # 学生
    path("students/",StudentView.as_view({"get": "all_student","post": "add_student"})),
    path("student/<int:id>",StudentViewTow.as_view({"get": "one_student","put": "upd_student","delete": "del_student"})),

    # 老师
    path("teachers/",TeacherView.as_view({"get": "all_teacher","post": "add_teacher"})),
    path("teacher/<int:id>",TeacherViewTow.as_view({"get": "one_teacher","put": "upd_teacher","delete": "del_teacher"})),
]


























